<?php
$this->title = '送货订单打印';
/** @var $model \common\models\c2\entity\InventoryDeliveryNote */
?>

<style>
    .tc {
        text-align: center
    }
</style>
<div class="container-fluid">

    <div class="tc">
        <h2 style="font-size: 30px;">中山市祥丰（帕奇）家居用品有限公司</h2>
        <h2 style="font-size: 20px;">ZHONG SHAN XIANG FENG HOUSEWARE (PA QI)Co.,LTD</h2>
        <h5 style="font-size: 18px;">送货订单</h5>
    </div>

    <div class="row">
        <div class="col">SO:<?= $model->code ?></div>
        <div class="col">电话：<?= $model->warehouse->contact_phone ?></div>
        <div class="col">传真：<?= $model->warehouse->fax ?></div>
        <div class="col">送货日期：<?= date('Y-m-d', strtotime($model->occurrence_date)) ?></div>
    </div>

    <div class="row">
        <div class="col">收货单位：<?= $model->label ?></div>
    </div>

    <table class="table table-bordered">

        <tr class="tc">
            <td>编号</td>
            <td>名称/规格</td>
            <td>包装</td>
            <td>件数</td>
            <td>数量</td>
            <td>单价</td>
            <td>金额/元</td>
            <td>备注</td>
        </tr>

        <?php
        $noteItems = $model->getNoteItems()->with('product', 'package', 'productSku')->all();
        ?>

        <?php foreach ($noteItems as $item): ?>
            <tr class="tc">
                <td><?= $item->product->sku ?></td>
                <td><?= $item->product->name . $item->productSku->label ?></td>
                <td><?= $item->package->label ?></td>
                <td><?= $item->pieces ?></td>
                <td><?= $item->quantity ?></td>
                <td><?= $item->price ?></td>
                <td><?= $item->subtotal ?></td>
                <td><?= $item->memo ?></td>
            </tr>

        <?php endforeach; ?>

        <tr class="">
            <td class="" colspan="6">
                合计金额大写(人民币)：<?= \common\helpers\MoneyHelper::trendNumToChiness($model->grand_total) ?></td>
            <td class="tc"><?= $model->grand_total ?></td>
            <td class=""></td>
        </tr>

    </table>

    <div class="row pt10">
        <div class="col">送货单位：<?= $model->warehouse->name ?></div>
        <div class="col">地址：<?= $model->warehouse->address ?></div>
    </div>

    <div>
        <?= $model->memo ?>
    </div>

</div>







